package moon.core.entity;

import moon.core.Name;
import moon.core.classdef.ClassDef;
import moon.core.classdef.Type;

/** 
 * Predefined entity represents the direct ancestor of thecurrent object.
 * 
 * @author <a href="mailto:rmartico@ubu.es">Ra&uacute;l Marticorena</a>
 * @since JavaMoon-1.3
 */
@SuppressWarnings("serial")
public abstract class Super extends PredefinedEntity {
	
	/**
	 * Constructor.
	 * 
	 * @param name name
	 * @param type type
	 */
	public Super(Name name, Type type) {
		super(name, type);		
	}
	
	/**
	 * Class.
	 */
	private ClassDef classDef;
	
	/**
	 * Implements abstract method NamedObject.getUniqueName.
     * {@inheritDoc}
     * 
     * Name convention: nameSpace.clasName#super
     * 
     * @return {@inheritDoc}
     * @since JavaMoon-1.3.5
     * 
     * FIXME review
     */
	@Override
    public Name getUniqueName(){    	
    	return  this.getType().getClassDef().getUniqueName().concat("#super");
    }
    
    /**
     * Returns the class of the current reference.
     * 
     * @return the current class 
     * @since JavaMoon-1.3.5
     * @see #setClassDef
     */
    public ClassDef getClassDef(){
    	return classDef;
    }
    
    /**
     * Changes the class of the current reference.
     * 
     * @param classDef new class
     * @since JavaMoon-1.3.5
     * @see #getClassDef     
     */
    public void setClassDef(ClassDef classDef){
    	this.classDef = classDef;
    }
   
} // Self
